onCreateOptionsMenu
Deprecated
androidx.activity.ComponentActivity now implements MenuHost, an interface that allows any component, including your activity itself, to add menu items by calling addMenuProvider without forcing all components through this single method override. As this provides a consistent, optionally Lifecycle -aware, and modular way to handle menu creation and item selection, replace usages of this method with one or more calls to addMenuProvider in your Activity's onCreate method, having each provider override onCreateMenu to create their menu items.
Initialize the contents of the Fragment host's standard options menu. You should place your menu items in to menu. For this method to be called, you must have first called setHasOptionsMenu. See Activity.onCreateOptionsMenu for more information.
Parameters
The options menu in which you place your items.